#include "converseprivateconversation.h"
#include "account/accountmember.h"
#include "account/accountbuddy.h"
#include "contact/contactprivatecontact.h"


namespace Converse {

PrivateConversation::PrivateConversation(qint64 id,
                                         Contact::PrivateContact *contact,
                                         QObject *parent)
    : Converse::AbstractConversation(id, contact, parent)
{
}


AbstractConversation::Type PrivateConversation::type() const
{
    return AbstractConversation::PrivateType;
}


qint64 PrivateConversation::toId() const
{
    return contact()->id();
}




Contact::PrivateContact *PrivateConversation::privateContact() const
{
    Contact::AbstractContact *abstractContact = contact();
    if (abstractContact == NULL)
        return NULL;

    Contact::PrivateContact *privateContact = \
            dynamic_cast<Contact::PrivateContact *>(abstractContact);
    if (privateContact == NULL)
        return NULL;

    return privateContact;
}

} // namespace Converse
